//
//  ViewController.m
//  GPUImage
//
//  Created by dllo on 15/9/28.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "ViewController.h"

#import "GPUImage.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    
    UIImage *inputImage = [UIImage imageNamed:@"1.jpg"];
    
    GPUImageBrightnessFilter *p = [[GPUImageBrightnessFilter alloc]init];
    p.brightness = - 0.5;
    
    [p forceProcessingAtSize:inputImage.size];
    
    [p useNextFrameForImageCapture];
    
    GPUImagePicture *s = [[GPUImagePicture alloc]initWithImage:inputImage];
    
    [s addTarget:p];
    
    [s processImage];
    
    UIImage *n = [p imageFromCurrentFramebuffer];
    
    UIImageView *imageView = [[UIImageView alloc]initWithImage:n];
    
    imageView.frame = CGRectMake(0, 0, inputImage.size.width / 2, inputImage.size.height / 2);

    [self.view addSubview:imageView];
    
    
    NSLog(@"111111111");
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
